package com.csc.mtlbatch.jde.batchprograms;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.csc.mtlbatch.jde.cls.Ct087;
import com.csc.smart400framework.parent.Mainb;
import com.quipoz.framework.datatype.FixedLengthStringData;
import com.quipoz.framework.datatype.PackedDecimalData;

public class Bt087 extends Mainb {

	private FixedLengthStringData lsaaStatuz = new FixedLengthStringData(4);
	private FixedLengthStringData lsaaBsscrec = new FixedLengthStringData(1024);
	private FixedLengthStringData lsaaBsprrec = new FixedLengthStringData(1024);
	private FixedLengthStringData lsaaBprdrec = new FixedLengthStringData(1024);
	private FixedLengthStringData lsaaBuparec = new FixedLengthStringData(1024);
	
	private FixedLengthStringData wsaaProg = new FixedLengthStringData(5).init("BT087");
	private PackedDecimalData wsaaCommitCnt = new PackedDecimalData(8, 0);
	private PackedDecimalData wsaaCycleCnt = new PackedDecimalData(8, 0);
	private FixedLengthStringData wsspEdterror = new FixedLengthStringData(4);
	
	private static final Logger LOGGER = LoggerFactory.getLogger(Bt087.class);
	
	public void mainline(Object... parmArray)
	{
		lsaaBuparec = convertAndSetParam(lsaaBuparec, parmArray, 4);
		lsaaBprdrec = convertAndSetParam(lsaaBprdrec, parmArray, 3);
		lsaaBsprrec = convertAndSetParam(lsaaBsprrec, parmArray, 2);
		lsaaBsscrec = convertAndSetParam(lsaaBsscrec, parmArray, 1);
		lsaaStatuz = convertAndSetParam(lsaaStatuz, parmArray, 0);
		
		Boolean retGen = false;
		
		LOGGER.info("Call Bt087 FROM CSC-MTL-BATCH PROJECT");

		try {
			
			Ct087 write = new Ct087();
			retGen = write.writing();
			
			if (retGen){
				LOGGER.info("Bt087 file generate Success.");
			}else{
				LOGGER.error("Bt087 file generate fail.");
			}

	    } catch (Exception ex) {
	        LOGGER.error("Problem writing to the file.");
	        ex.printStackTrace();
	    } 
	}
	
	public Bt087() {
		super();
	}
	
	@Override
	protected void close4000() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void commit3500() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void edit2500() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void initialise1000() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void readFile2000() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void restart0900() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void rollback3600() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void update3000() {
		// TODO Auto-generated method stub

	}

	public FixedLengthStringData getWsaaProg() {
		return wsaaProg;
	}

	public void setWsaaProg(FixedLengthStringData wsaaProg) {
		this.wsaaProg = wsaaProg;
	}

	public PackedDecimalData getWsaaCommitCnt() {
		return wsaaCommitCnt;
	}

	public void setWsaaCommitCnt(PackedDecimalData wsaaCommitCnt) {
		this.wsaaCommitCnt = wsaaCommitCnt;
	}

	public PackedDecimalData getWsaaCycleCnt() {
		return wsaaCycleCnt;
	}

	public void setWsaaCycleCnt(PackedDecimalData wsaaCycleCnt) {
		this.wsaaCycleCnt = wsaaCycleCnt;
	}

	public FixedLengthStringData getWsspEdterror() {
		return wsspEdterror;
	}

	public void setWsspEdterror(FixedLengthStringData wsspEdterror) {
		this.wsspEdterror = wsspEdterror;
	}

	public FixedLengthStringData getLsaaStatuz() {
		return lsaaStatuz;
	}

	public void setLsaaStatuz(FixedLengthStringData lsaaStatuz) {
		this.lsaaStatuz = lsaaStatuz;
	}

	public FixedLengthStringData getLsaaBsscrec() {
		return lsaaBsscrec;
	}

	public void setLsaaBsscrec(FixedLengthStringData lsaaBsscrec) {
		this.lsaaBsscrec = lsaaBsscrec;
	}

	public FixedLengthStringData getLsaaBsprrec() {
		return lsaaBsprrec;
	}

	public void setLsaaBsprrec(FixedLengthStringData lsaaBsprrec) {
		this.lsaaBsprrec = lsaaBsprrec;
	}

	public FixedLengthStringData getLsaaBprdrec() {
		return lsaaBprdrec;
	}

	public void setLsaaBprdrec(FixedLengthStringData lsaaBprdrec) {
		this.lsaaBprdrec = lsaaBprdrec;
	}

	public FixedLengthStringData getLsaaBuparec() {
		return lsaaBuparec;
	}

	public void setLsaaBuparec(FixedLengthStringData lsaaBuparec) {
		this.lsaaBuparec = lsaaBuparec;
	}



}
